import { ref, provide, nextTick } from "vue";

export default function () {
  // 局部组件刷新
  const isRouterAlive = ref(true);
  const reload = () => {
    isRouterAlive.value = false;
    nextTick(() => {
      isRouterAlive.value = true;
    });
  };
  // 向项目中注入 reload    子组件通过reFreshed 调用
  provide("reFreshed", reload);
  return isRouterAlive;
}
